<?php
/**
 * 订单商品模型
*/

namespace app\common\model;

use think\model\concern\SoftDelete;

class OrderGoods extends CommonBaseModel
{
    use SoftDelete;
    // 自定义选择数据
    

    protected $name = 'order_goods';
    protected $autoWriteTimestamp = true;

    // 可搜索字段
    public array $searchField = [];

    // 可作为条件的字段
    public array $whereField = [];

    // 可作为多选条件的字段
    public array $multiWhereField = ['user_id','order_id','shop_id','goods_id','goods_item_id',];

    // 可做为时间
    public array $timeField = [];

    

    /**
    * 关联用户
    */
    public function user()
    {
        return $this->belongsTo(User::class);
    }/**
    * 关联
    */
    public function order()
    {
        return $this->belongsTo(Order::class);
    }/**
    * 关联
    */
    public function shop()
    {
        return $this->belongsTo(Shop::class);
    }/**
    * 关联
    */
    public function goods()
    {
        return $this->belongsTo(Goods::class);
    }/**
    * 关联
    */
    public function goodsItem()
    {
        return $this->belongsTo(GoodsItem::class);
    }

}
